import { Controller, Get, HttpStatus, Param } from '@nestjs/common';
import { AudioCateService } from './audio_cate.service';
import { ApiResponse } from 'src/apiResponse ';

@Controller('audio-cate')
export class AudioCateController {
  constructor(private readonly audioCateService: AudioCateService) {}
  @Get('cateAll/:id')
  async getCateAll(@Param('id') id: string) {
    try {
      const audios = await this.audioCateService.getAudioCateListById(id);
      return ApiResponse.success(audios);
    } catch (error) {
      return ApiResponse.error(
        HttpStatus.INTERNAL_SERVER_ERROR,
        'Error retrieving items',
        error.message || 'Internal server error',
      );
    }
  }
}
